package com.wlient.basic.Optional;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

/**
 * @author: 史炜立
 * @date: 2022/3/25 9:16
 */
public class OptionalTest {


    public static void main(String[] args) {
        List<Integer> list = null;
        System.out.println(list);
        Integer i = 9;
        list = Optional.ofNullable(list).orElse(new ArrayList<>());
        System.out.println(list);
    }
}
